IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[UpdateDetallePedido]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[UpdateDetallePedido]
GO

CREATE PROCEDURE [dbo].[UpdateDetallePedido]
(
	@IdPedido int,
	@IdProducto int,
	@Cantidad int,
	@Precio money,
	@Descuento decimal(4, 2)
)
AS
BEGIN
	SET NOCOUNT ON

	UPDATE [DetallePedido]
	SET [Cantidad] = @Cantidad, 
		[Precio] = @Precio, 
		[Descuento] = @Descuento
	WHERE [IdPedido] = @IdPedido AND [IdProducto] = @IdProducto

	SET NOCOUNT OFF
END

GO
